<template>
  <div class="setnotice-content">
    <div class="setbox">
      <div class="jiushibox">
        <textarea class="settext" placeholder="请输入您想添加的简介" v-model="content"></textarea>
      </div>
    </div>
    <div class="addbtn" @click="Suk_savenotice">确定添加</div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tit: "",
      content: ""
    };
  },
  beforeCreate: function() {
    //创建前
  },
  create: function() {
    //创建后
  },
  beforeMount: function() {
    //挂载前
  },
  mounted: function() {
    //挂载后
  },
  beforeUpdate: function() {
    //更新前
  },
  updated: function() {
    //更新后
  },
  methods: {
    Suk_savenotice() {
      let that = this;
      that.$toast.loading({
        message: "加载中..."
      });
      var Sukdata = {
//      id: localStorage.getItem("storeid"),
				userid: localStorage.getItem("userid"),
        diningIntro: that.content
      };
      console.log(Sukdata);
      that.axios
        .post(
          that.baseUrl + "/dining/updateImages",
          that.Qs.stringify(Sukdata),
          {
            headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            }
          }
        )
        .then(function(res) {
          if (res.data.meta.code == -1) {
//            console.log(res.data);
              that.$toast.success({
                message: "商家不存在！"
              });
            } else if (res.data.meta.code == 1) {
            	that.$toast.success({
                message: "修改成功！"
              });
              that.$router.go(-1)
            }else if (res.data.meta.code == -2) {
            	that.$toast.success({
                message: "修改失败！"
              });
          }
        });
    }
  }
};
</script>
<style lang="scss" scoped>
textarea {
  background: #fff;
}
.setnotice-content {
  font-size: 0.3rem;
  background: #f0f0f0;
  padding-bottom: 13rem;
}
.setbox {
  background: #fff;
  box-shadow: 0rem 0.05rem 0.2rem 0.1rem #e7e7e7;
  h1 {
    height: 1rem;
    line-height: 1rem;
    font-weight: 600;
    font-size: 0.5rem;
    border-bottom: 1px solid #f4f4f4;
  }
}
.jiushibox {
  width: 90%;
  margin: 0 auto;
}
.settext {
  margin-top: 0.1rem;
  width: 100%;
  height: 4rem;
  border: none;
}
.addbtn {
  background: #fda229;
  width: 80%;
  text-align: center;
  color: #fff;
  height: 1.1rem;
  line-height: 1.1rem;
  margin: 2rem auto;
  border-radius: 0.5rem;
  box-shadow: 0rem 0.05rem 0.2rem 0.1rem #e7e7e7;
}
.tit {
  border: none;
}
</style>